import pytest
import requests
from send.Send import Send
from utils.read_yaml import read_yaml


class Test_buy_termFinancal:

    @pytest.mark.parametrize( "args", read_yaml("D:/Projects/接口自动化/data/buy_termFinancal.yaml")  )
    def  test_buy_termFinancal(self,args):

        se = Send()
        login_username = args["username"]
        session = se.ceshi_buy_login(login_username)

        exp = args["exp"]

        # session  = requests.session()
        #
        # se = Send()
        result = se.send_buy_termFinancal(session,args)

        assert result["code"] == 200 and result["body"]["code"] == exp